"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . views import views,typeviews,goodsviews

urlpatterns = [

    # ajax上传文件
    url(r'^ajax/upload/$',views.ajaxupload,name='admin_ajax_upload'),
    # 后台首页
    url(r'^$',views.index,name='adminindex'),
    # 后台登录
    url(r'^login/$',views.login,name='admin_login'),
    # 退出登录
    url(r'^loginout/$',views.loginout,name='admin_loginout'),

    # 验证码 verifycode
    url(r'^getvcode/$',views.verifycode,name='getvcode'),

    #用户添加
    url(r'^user/add/$',views.useradd,name='admin_user_add'),
    #执行添加
    url(r'^user/insert/$',views.userinsert,name='admin_user_insert'),
    #用户列表
    url(r'^user/list/$',views.userlist,name='admin_user_list'),
    #用户删除
    url(r'^user/del/(?P<uid>[0-9]+)$',views.userdel,name='admin_user_del'),
    #用户编辑
    url(r'^user/edit/(?P<uid>[0-9]+)$',views.useredit,name='admin_user_edit'),
    #用户修改
    url(r'^user/update/$',views.userupdate,name='admin_user_update'),
    #用户状态更新
    url(r'^user/status/$',views.userstatus,name='admin_user_status'),



# -------------------------------------------------------

    
    #商品分类管理
    url(r'^types/add/$',typeviews.typesadd,name="admin_types_add"),

    url(r'^types/insert/$',typeviews.typesinsert,name="admin_types_insert"),

    url(r'^types/list/$',typeviews.typeslist,name="admin_types_list"),

    url(r'^types/edit/(?P<tid>[0-9]+)$',typeviews.typesedit,name="admin_types_edit"),

    url(r'^types/update/$',typeviews.typesupdate,name='admin_types_update'),

    url(r'^types/del/$',typeviews.typesdel,name='admin_types_del'),



#----------------------------------------
    #商品列表管理 
    #商品添加   
    url(r'^goods/add/$',goodsviews.goodsadd,name="admin_goods_add"),
    #商品执行添加
    url(r'^goods/insert/$',goodsviews.goodsinsert,name='admin_goods_insert'),
    #商品列表
    url(r'^goods/list/$',goodsviews.goodslist,name="admin_goods_list"),
    #编辑
    url(r'^goods/edit/(?P<uid>[0-9]+)$',goodsviews.goodsedit,name='admin_goods_edit'),
    # #修改更新
    url(r'^goods/update/$',goodsviews.goodsupdate,name='admin_goods_update'),
    # #删除
    url(r'^goods/del/$',goodsviews.goodsdel,name='admin_goods_del'),
    # 用户状态更新
    url(r'^goods/status/$',goodsviews.goodsstatus,name='admin_goods_status'),



]
